/*************************************************
Author: will
Date: 10/29/2012
Description:
Notes: 
*************************************************/

#ifndef __cmdinstance_h__
#define __cmdinstance_h__

#include "../maindef.h"
#include "CTAsyncCmd.h"
#include "MsgInstance.pb.h"
#include "../item/CDropItem.h"

class CMainCtrl;
class CStorageGrid;
class CUserStorage;
class CCmdGotoInstance : public CTAsyncCmd
{
public:
	CCmdGotoInstance() 
    {
	}

	virtual ~CCmdGotoInstance() 
    {
	}

public:
    virtual int Do(void* pData);
    virtual int LogicDo(int iRet);
    virtual int AnsClients(int iRet);

	CEnpNetHead stEnpHead;
    PBMsgHead  stMsgHead;
    CMainCtrl* pstMainCtrl;

    unsigned int uiGID;
    MsgReqGotoInstance stReq;
    MsgAnsGotoInstance stAns;
};

class CCmdAtkInstance : public CTAsyncCmd
{
public:
    CCmdAtkInstance() 
    {
    }

    virtual ~CCmdAtkInstance() 
    {
    }

public:
    virtual int Do(void* pData);
    virtual int LogicDo(int iRet);
    virtual int CallBack(int iRet);
    virtual int AnsClients(int iRet);

    CEnpNetHead stEnpHead;
    PBMsgHead  stMsgHead;
    CMainCtrl* pstMainCtrl;

    unsigned int uiGID;
    MsgReqAtkInstance stReq;
    MsgAnsAtkInstance stAns;

private:    
};

class CCmdLeaveInstance : public CTAsyncCmd
{
public:
	CCmdLeaveInstance() 
    {
	}

	virtual ~CCmdLeaveInstance() 
    {
	}

public:
    virtual int Do(void* pData);
    virtual int LogicDo(int iRet);
    virtual int AnsClients(int iRet);

    CEnpNetHead stEnpHead;
    PBMsgHead  stMsgHead;
    CMainCtrl* pstMainCtrl;

    unsigned int uiGID;
    MsgReqLeaveInstance stReq;
};

//扫荡
class CCmdSweepInstance : public CTAsyncCmd
{
public:
    CCmdSweepInstance() 
    {
    }

    virtual ~CCmdSweepInstance() 
    {
    }

public:
    virtual int Do(void* pData);
    virtual int LogicDo(int iRet);
    virtual int CallBack(int iRet);
    virtual int AnsClients(int iRet);

    CEnpNetHead stEnpHead;
    PBMsgHead  stMsgHead;
    CMainCtrl* pstMainCtrl;

    unsigned int uiGID;
    CDropItem stDropItem;
    MsgReqSweepInstance stReq;
    MsgAnsSweepInstance stAns;
};

//领取副本奖励
class CCmdGetInsWinBonus : public CTAsyncCmd
{
public:
    CCmdGetInsWinBonus() 
    {
        bFlushCache = true;
    }

    virtual ~CCmdGetInsWinBonus() 
    {
    }

public:
    virtual int Do(void* pData);
    virtual int LogicDo(int iRet);
    virtual int CallBack(int iRet);
    virtual int AnsClients(int iRet);    

    CEnpNetHead stEnpHead;
    PBMsgHead  stMsgHead;
    CMainCtrl* pstMainCtrl;

    unsigned int uiGID;
    CDropItem stDropItem;
    MsgReqGetInstanceBonus stReq;
    MsgAnsGetInstanceBonus stAns;

    bool bFlushCache;
};

//副本通用操作
class CCmdInstanceOpt : public CTAsyncCmd
{
public:
    CCmdInstanceOpt() 
    {
    }

    virtual ~CCmdInstanceOpt() 
    {
    }

public:
    virtual int Do(void* pData);
    virtual int LogicDo(int iRet);
    virtual int AnsClients(int iRet);

    CEnpNetHead stEnpHead;
    PBMsgHead  stMsgHead;
    CMainCtrl* pstMainCtrl;

    unsigned int uiGID;
    MsgReqInstanceOpt stReq;
    MsgAnsInstanceOpt stAns;
};

//秘境操作
class CCmdSecretInstance : public CTAsyncCmd
{
public:
    CCmdSecretInstance() 
    {
    }

    virtual ~CCmdSecretInstance() 
    {
    }

public:
    virtual int Do(void* pData);
    virtual int LogicDo(int iRet);
    virtual int AnsClients(int iRet);
    int GetCardInfo(unsigned int uiBoxID, CDropItem& stGiftDropItem, ::google::protobuf::RepeatedPtrField<MsgGridItemInfo>& stInfos);    
        
    CEnpNetHead stEnpHead;
    PBMsgHead  stMsgHead;
    CMainCtrl* pstMainCtrl;

    unsigned int uiGID;
    MsgReqSecretInstance stReq;
    MsgAnsSecretInstance stAns;
};




#endif // __cmdinstance_h__

